@extends('admin/layout')
@section('title','会员管理')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    <a href="{{asset('admin/manage')}}">管理列表</a>
    <small>这是管理列表页面</small>
  </h1>
  <ol class="breadcrumb">
  	<li><a href="{{asset('admin/index')}}"><i class="fa fa-th"></i> 管理首页</a></li>
    <li><i class="fa fa-users"></i> 会员管理</li>
    <li><a href="{{asset('admin/manage')}}"><i class="fa fa-user"></i> 管理列表</a></li>
    <li class="active">管理列表</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-md-12">
      <!-- box start -->
      <div class="box box-info">
       @if(session('success'))
          <div class="alert alert-danger">                               
              {{session('success')}}
          </div>
      @endif                      
      <div class="box-header with-border">
        <h3 class="box-title"><i class="fa fa-user"><a href="{{asset('admin/manage')}}"> 管理列表</a></i></h3>
      </div>
      <div class="box-body">
        <div class="row">
          &nbsp;
        </div>
        <form class="form-inline" action="{{asset('admin/manage')}}" method="get">
          <div class="form-group">
            <label for="inputname" class="">会员名称</label>&nbsp;
            <input id="inputname" value="{{$request['keywords'] or ''}}"name="keywords" type="text" class="form-control">
          </div>
          <div class="form-group col-md-offset-7">
            <label>每页条数</label>&nbsp;
            <select name="num" class="form-control">
              <option
              @if(!empty($request['num']) && $request['num'] == 10)
                   selected
              @endif>10
              </option>
              <option 
              @if(!empty($request['num']) && $request['num'] == 20)
                   selected
              @endif>20</option>
              <option 
              @if(!empty($request['num']) && $request['num'] == 50)
                   selected
              @endif>30</option>
          </select>
          </div>
          <div class="form-group">
            <button  class="btn bg-purple">查询</button>
          </div>
        </form>
        <div class="row">
          &nbsp;
        </div>
        <div class="table-responsive">
        <table id="member_list" class="table table-bordered table-striped text-center">
          <thead>
          <tr>
            <th>选择</th>
            <th>序号</th>
            <th>管理员/站长名称</th>
            <th>手机号码</th>
            <th>电子邮箱</th>
            <th>上次登录时间</th>
            <th>登录状态</th>
            <th>禁用状态</th>
            <th colspan="3">操作</th>
          </tr>
          </thead>
          <tbody>
          @foreach($data as $v)
          <tr>
            <td><input type="checkbox"></td>
            <td>{{$v -> member_id}}</td>
            <td>{{$v -> name}}</td>
            <td>{{$v -> phone}}<!-- <i class="fa fa-check text-green"></i> --></td>
            <td>{{$v -> email}}<!-- <i class="fa fa-times text-red"></i> --></td>
            <td>{{$v -> ltime}}</td>         
             @if($v -> logged == 2) 
             <td><i class="fa fa-circle text-green"></i>
                在线
              </td>
             @else 
              <td><i class="fa fa-circle text-red"></i>
                离线
              </td>
             @endif          
            
            @if($v -> disabled == 1)
            <td><i class="fa fa-square text-green"></i> 
               可用
            </td>
            @else
            <td><i class="fa fa-square text-red"></i> 
               禁用
            </td>
            @endif
            <td>
              <a href="/admin/manage/{{$v -> member_id}}"><button class="btn-xs btn-success" type="button">详情</button></a>
            </td>
            <td>
                <a href="/admin/manage/{{$v -> member_id}}/edit"><button class="btn-xs btn-warning" type="button">更改</button></a>
            </td>
            <td>
              <a href="#">
                <button type="button" class="btn-xs btn-info">发送消息</button>
              </a>
            </td>
          </tr>
          @endforeach
          </tbody>
          <tfoot>
          <tr>
            <th colspan="3">
              <button type="button" class="btn-xs btn-primary">全选</button>
              <button type="button" class="btn-xs btn-primary">不选</button>
              <button type="button" class="btn-xs btn-primary">反选</button>
            </th>
            <th colspan="5"></th>
            <th colspan="3">
              <button type="button" class="btn-xs btn-info">发送全体消息</button>
            </th>
          </tr>
          </tfoot>
        </table>
        {!!$data ->appends($request) -> render()!!}
        </div>
      </div>
      <!-- /.box-body -->
      <!-- /.box -->        
    </div>
  </div>
</section>
<!-- /.content -->
@stop